import request from '@/utils/request'

export function getDepartments() {
  return request({ url: '/system/department', method: 'get' })
}

export function addDepartment(data) {
  return request({ url: '/system/department', data: data, method: 'post' })
}

export function editDepartment(data) {
  return request({ url: '/system/department', data: data, method: 'put' })
}

export function removeDepartment(id) {
  return request({ url: '/system/department/' + id, method: 'delete' })
}

export function getDepartmentTree(param) {
  return request({ url: '/system/department/option/tree', params: param, method: 'get' })
}
